﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DAL
{
    public static class GetInstructor
    {
        #region Get Instructors
        static testdbsEntities ctx = new testdbsEntities();


        public static List<Instructor> GetInstructors()
        {
            
                IQueryable<Instructor> tInstructor = from cs in ctx.Instructor
                                                     select cs;

                return tInstructor.ToList();
           
        }

        public static List<Instructor> GetInstructors(Instructor mInstrucor)
        {
            
                IQueryable<Instructor> tInstructor = from cs in ctx.Instructor
                                                     where cs == mInstrucor
                                                     select cs;

                return tInstructor.ToList();
         
        }

        public static List<Instructor> GetInstructorsByName(string mSname)
        {
            
                IQueryable<Instructor> tInstructor = from cs in ctx.Instructor
                                                     where cs.sname == mSname
                                                     select cs;

                return tInstructor.ToList();
         
        }

        public static List<Instructor> GetInstructorsByName(string mSname, string mName)
        {
            
                IQueryable<Instructor> tInstructor = from cs in ctx.Instructor
                                                     where cs.sname == mSname && cs.name == mName
                                                     select cs;
                return tInstructor.ToList();
         
        }

        public static List<Instructor> GetInstructorsByBDate(DateTime mBDate)
        {
            
                IQueryable<Instructor> tInstructor = from cs in ctx.Instructor
                                                     where cs.bdate == mBDate
                                                     select cs;
                return tInstructor.ToList();
         
        }

        #endregion

    }
}
